package com.pan.kang.model.cons;


import com.pan.kang.support.SqlResource;

public class AccComprehensiveQueryQtySqlDaoConst {
    public static final String MONTH_STA_CUR_GROUP_BY_CONDITION = " ,A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE";
    public static final String MONTH_STA_CUR_INSERT_CONDITION2 = ",NUMTYPE,NUMSCALETYPE,\n\t\t\t\tSUM(WD51),SUM(QCYE_HL),\n\t\t\t\tSUM(WD52),SUM(SUM_SL_J),\n\t\t\t\tSUM(WD53),SUM(SUM_SL_D),\n\t\t\t\tSUM(WD54),SUM(QMYE_HL),\n\t\t\t\tSUM(WD55),SUM(SUM_SL_JL),\n\t\t\t\tSUM(WD56),SUM(SUM_SL_DL)\n\t\t\t\t";
    public static final String MONTH_STA_CUR_INSERT_CONDITION = ",NUMTYPE,NUMSCALETYPE,\n\t\t\t\tWD51,QCYE_HL,\n\t\t\t\tWD52,SUM_SL_J,\n\t\t\t\tWD53,SUM_SL_D,\n\t\t\t\tWD54,QMYE_HL,\n\t\t\t\tWD55,SUM_SL_JL,\n\t\t\t\tWD56,SUM_SL_DL,\n\t\t\t\tBZLX";
    public static final String MONTH_STA_CUR_INSERT_CONDITION3 = ",NUMTYPE,NUMSCALETYPE,\n\t\t\t\tWD51,QCYE_HL,\n\t\t\t\tWD52,SUM_SL_J,\n\t\t\t\tWD53,SUM_SL_D,\n\t\t\t\tWD54,QMYE_HL,\n\t\t\t\tWD55,SUM_SL_JL,\n\t\t\t\tWD56,SUM_SL_DL\n\t\t\t\t";
    public static final String MONTH_STA_CUR_SELECT_CONDITION3 = " ,A1.MEASUR_UNIT,A1.MEAS_UNIT_GROUP_CODE, \n\t       SUM(A1.QCYE_SL),SUM(A1.QCYE_DJ),\n\t       SUM(A1.SUM_J_SL),SUM(A1.SUM_J_DJ),\n\t       SUM(A1.SUM_D_SL),SUM(A1.SUM_D_DJ),\n\t       SUM(A1.QMYE_SL),SUM(A1.QMYE_DJ),\n\t       SUM(A1.SUM_JL_SL),SUM(A1.SUM_JL_DJ),\n\t       SUM(A1.SUM_DL_SL),SUM(A1.SUM_DL_DJ),\n\t       BZLX";
    public static final String MONTH_STA_CUR_SELECT_CONDITION2 = "\t       ,A1.MEASUR_UNIT,A1.MEAS_UNIT_GROUP_CODE, \n\t       A1.QCYE_SL,A1.QCYE_DJ,\n\t       A1.SUM_J_SL,A1.SUM_J_DJ,\n\t       A1.SUM_D_SL,A1.SUM_D_DJ,\n\t       A1.QMYE_SL,A1.QMYE_DJ,\n\t       A1.SUM_JL_SL,A1.SUM_JL_DJ,\n\t       A1.SUM_DL_SL,A1.SUM_DL_DJ,\n\t       BZLX";
    public static final String MONTH_FOR_CUR_SELECT_CONDITION = ",A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE,\n\t\t\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_S - A.DR_QTY_S END) QCYE_SL,\n\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_S - A.DR_QTY_S END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_BALP_S - A.DR_BALP_S END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_S - A.DR_QTY_S END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_BALP_S - A.DR_BALP_S END)\n\t\t\tEND QCYE_DJ,\n\t\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_TOT END) SUM_J_SL, \n\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_TOT END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_AMT_TOT END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_TOT END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_AMT_TOT END)\n\t\t\tEND SUM_J_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_TOT END) SUM_D_SL, \n\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_TOT END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_AMT_TOT END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_TOT END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_AMT_TOT END)\n\t\t\tEND SUM_D_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END) QMYE_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_E - A.DR_BALP_E END) /  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_E - A.DR_BALP_E END)\n\t\t\tEND QMYE_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END) SUM_JL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END) <> 0  \n\t\t\t   THEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_AMT_Y END)  /  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_AMT_Y END)\n\t\t\tEND SUM_JL_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END) SUM_DL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END) <> 0\n\t\t\t   THEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_AMT_Y END)  /  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_AMT_Y END)\n\t\t\tEND SUM_DL_DJ,\n\t\t\t\n\t\t\t9999 BZLX";
    public static final String MONTH_STA_CUR_SELECT_CONDITION = "\t\t\t,A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE,\n\t\t\n\t\t\tSUM(A.CR_QTY_S - A.DR_QTY_S) QCYE_SL,\n\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_S - A.DR_QTY_S) <> 0 THEN SUM(A.CR_BALP_S - A.DR_BALP_S) /  SUM(A.CR_QTY_S - A.DR_QTY_S)\n\t\t\t   ELSE SUM(A.CR_BALP_S - A.DR_BALP_S)\n\t\t\tEND QCYE_DJ,\n\t\n\t\t\tSUM(A.DR_QTY_TOT) SUM_J_SL, \n\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.DR_QTY_TOT) <> 0 THEN SUM(A.DR_AMT_TOT) /  SUM(A.DR_QTY_TOT)\n\t\t\t   ELSE SUM(A.DR_AMT_TOT)\n\t\t\tEND SUM_J_DJ,\n\t\t\t\n\t\t\tSUM(A.CR_QTY_TOT) SUM_D_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_TOT) <> 0 THEN SUM(A.CR_AMT_TOT) /  SUM(A.CR_QTY_TOT)\n\t\t\t   ELSE SUM(A.CR_AMT_TOT)\n\t\t\tEND SUM_D_DJ,\n\t\t\t\n\t\t\tSUM(A.CR_QTY_E - A.DR_QTY_E) QMYE_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_E - A.DR_QTY_E) <> 0 THEN SUM(A.CR_BALP_E - A.DR_BALP_E) /  SUM(A.CR_QTY_E - A.DR_QTY_E)\n\t\t\t   ELSE SUM(A.CR_BALP_E - A.DR_BALP_E)\n\t\t\tEND QMYE_DJ,\n\t\t\t\n\t\t\tSUM(A.CR_QTY_Y) SUM_JL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_Y) <> 0 THEN SUM(A.CR_AMT_Y) /  SUM(A.CR_QTY_Y)\n\t\t\t   ELSE SUM(A.CR_AMT_Y)\n\t\t\tEND SUM_JL_DJ,\n\t\t\t\n\t\t\tSUM(A.DR_QTY_Y) SUM_DL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.DR_QTY_Y) <> 0 THEN SUM(A.DR_AMT_Y) /  SUM(A.DR_QTY_Y)\n\t\t\t   ELSE SUM(A.DR_AMT_Y)\n\t\t\tEND SUM_DL_DJ,\n\t\t\t\n\t\t\t9999 BZLX";
    public static final String MONTH_FOR_CUR_1Y_SELECT_CONDITION = ",A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE,\n\t        \n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_E - A.DR_QTY_E - A.CR_QTY_Y + A.DR_QTY_Y END) QCYE_SL,\n\t\n\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_E - A.DR_QTY_E - A.CR_QTY_Y + A.DR_QTY_Y END)  <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_BALP_E - A.DR_BALP_E - A.CR_AMT_Y + A.DR_AMT_Y END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_E - A.DR_QTY_E - A.CR_QTY_Y + A.DR_QTY_Y END) \n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_BALP_E - A.DR_BALP_E - A.CR_AMT_Y + A.DR_AMT_Y END)\n\t\t\tEND QCYE_DJ,\n\t\n\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_Y END) SUM_J_SL,\n\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_Y END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_AMT_Y END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_Y END) \n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_AMT_Y END)\n\t\t\tEND SUM_J_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_Y END) SUM_D_SL,\n\n\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_Y END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_AMT_Y END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_AMT_Y END)\n\t\t\tEND SUM_D_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END) QMYE_SL,\n\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_E - A.DR_BALP_E END) /  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_E - A.DR_BALP_E END)\n\t\t\tEND QMYE_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END) SUM_JL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END) <> 0  \n\t\t\t   THEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_AMT_Y END)  /  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_AMT_Y END)\n\t\t\tEND SUM_JL_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END) SUM_DL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END) <> 0\n\t\t\t   THEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_AMT_Y END)  /  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_AMT_Y END)\n\t\t\tEND SUM_DL_DJ,\n\t\t\t\n\t\t\t9999 BZLX";
    public static final String MONTH_STA_CUR_1Y_SELECT_CONDITION = "\t       ,A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE,\n\t\t\n\t\t\n\t\t\tSUM(A.CR_QTY_E - A.DR_QTY_E  - (A.CR_QTY_Y - A.DR_QTY_Y)) QCYE_SL, \n\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_E - A.DR_QTY_E  - (A.CR_QTY_Y - A.DR_QTY_Y)) <> 0 \n\t\t\t   THEN SUM(A.CR_BALP_E - A.DR_BALP_E  - (A.CR_AMT_Y - A.DR_AMT_Y))  /  SUM(A.CR_QTY_E - A.DR_QTY_E  - (A.CR_QTY_Y - A.DR_QTY_Y))\n\t\t\t   ELSE SUM(A.CR_BALP_E - A.DR_BALP_E  - (A.CR_AMT_Y - A.DR_AMT_Y)) \n\t\t\tEND QCYE_DJ,\n\t\n\t\t\tSUM(A.CR_QTY_Y) SUM_J_SL, \n\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_Y) <> 0 \n\t\t\t   THEN SUM(A.CR_AMT_Y) /  SUM(A.CR_QTY_Y)\n\t\t\t   ELSE SUM(A.CR_AMT_Y)\n\t\t\tEND SUM_J_DJ,\n\t\t\t\n\t\t\tSUM(A.DR_QTY_Y) SUM_D_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.DR_QTY_Y) <> 0 \n\t\t\t   THEN SUM(A.DR_AMT_Y) /  SUM(A.DR_QTY_Y)\n\t\t\t   ELSE SUM(A.DR_AMT_Y)\n\t\t\tEND SUM_D_DJ,\n\t\t\t\n\t\t\tSUM(A.CR_QTY_E - A.DR_QTY_E) QMYE_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_E - A.DR_QTY_E) <> 0 \n\t\t\t   THEN SUM(A.CR_BALP_E - A.DR_BALP_E) /  SUM(A.CR_QTY_E - A.DR_QTY_E)\n\t\t\t   ELSE SUM(A.CR_BALP_E - A.DR_BALP_E)\n\t\t\tEND QMYE_DJ,\n\t\t\t\n\t\t\tSUM(A.CR_QTY_Y) SUM_JL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_Y) <> 0 \n\t\t\t   THEN SUM(A.CR_AMT_Y) /  SUM(A.CR_QTY_Y)\n\t\t\t   ELSE SUM(A.CR_AMT_Y)\n\t\t\tEND SUM_JL_DJ,\n\t\t\t\n\t\t\tSUM(A.DR_QTY_Y) SUM_DL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.DR_QTY_Y) <> 0 \n\t\t\t   THEN SUM(A.DR_AMT_Y) /  SUM(A.DR_QTY_Y)\n\t\t\t   ELSE SUM(A.DR_AMT_Y)\n\t\t\tEND SUM_DL_DJ,\n\t\t\t\n\t\t\t9999 BZLX";
    private static final String SQL_CLASS = AccComprehensiveQueryQtySqlDaoConst.class.getName();
    public static String SQL_REBUILD_ITEM_TREE = "INSERT INTO GT_KMDESTTAB\n\t\t\t\t  (IID, FLGID, ITEMCODE, CODE, CAPTION, LEAF, ITEMLEVEL, STOPED,CAP1 ,CAP2 ,KMTYPEID, VER_ID)\nSELECT A.IID,A.FLGID,A.ITEMCODE,A.CODE,A.CAPTION,A.LEAF,A.ITEMLEVEL,A.STOPED ,\n\t   CASE WHEN A.LEAF=0 THEN C.MEASUNITGROUPCODE ELSE B.F_CHAR1 END AS MEASUNITGROUPCODE,\n\t   CASE WHEN A.LEAF=0 AND C.MEASUNITGROUPCODE IS NULL THEN NULL  ELSE B.F_CHAR2 END AS MEASUREUNITCODE,\n\t   B.F_NUM2 AS ISBASEUNIT,1\nFROM \nTEMP_1 A\nLEFT JOIN TEMP_3 B  ON B.F_NUM1 = A.IID\nLEFT JOIN \n(SELECT ITEMCODE , CASE WHEN COUNT(DISTINCT MEASUNITGROUPCODE) > 1 THEN NULL ELSE MAX(MEASUNITGROUPCODE) END AS MEASUNITGROUPCODE\nFROM\n\t(SELECT ITEMCODE ,LEAF ,F_CHAR1 AS MEASUNITGROUPCODE\n\tFROM temp_1 A LEFT JOIN TEMP_3 B ON B.F_NUM1 = A.IID ORDER BY A.ITEMCODE )\nWHERE\n\tLEAF = 0\nGROUP BY ITEMCODE) C ON C.ITEMCODE = A.ITEMCODE ";
    public static final String MONTH_STA_CUR_INSERT_INTO_GT_GENERAL_SES;
    public static final String MONTH_STA_CUR_INSERT_INTO_GT_ZW_WD_BILL_MX_FROM_GT_GENERAL_SES;
    public static final String MONTH_FOR_CUR_INSERT_INTO_GT_GENERAL_SES;
    public static final String MONTH_FOR_CUR_INSERT_INTO_GT_ZW_WD_BILL_MX_FROM_GT_GENERAL_SES;
    public static final String SELECT_KEY_VALUE_SQL_FILED2 = "       \t\t       ,NUMTYPE,NUMSCALETYPE,\n\t\t       \tQCYE_SL,QCYE_DJ,\n\t\t\t\tSUM_J_SL,SUM_J_DJ,\n\t\t\t\tSUM_D_SL,SUM_D_DJ,\n\t\t\t\tQMYE_SL,QMYE_DJ,\n\t\t\t\tSUM_JL_SL,SUM_JL_DJ,\n\t\t\t\tSUM_DL_SL,SUM_DL_DJ ";
    public static final String SELECT_KEY_VALUE_SQL_FILED = " \t\t       ,NUMTYPE NUMTYPE,NUMSCALETYPE NUMSCALETYPE,\n\t\t       \tSUM(QCYE_SL) QCYE_SL,\n\t\t       \tCASE WHEN SUM(QCYE_SL) IS NULL OR SUM(QCYE_SL) = 0 THEN 0 WHEN SUM(QCYE_BWB) <> 0 AND SUM(QCYE_SL) <> 0 THEN SUM(QCYE_BWB)/SUM(QCYE_SL) ELSE SUM(QCYE_BWB) END  QCYE_DJ,\n\t\t\t\tSUM(SUM_J_SL) SUM_J_SL,\n\t\t       \tCASE WHEN SUM(SUM_J_SL) IS NULL OR SUM(SUM_J_SL) = 0 THEN 0 WHEN SUM(SUM_J) <> 0 AND SUM(SUM_J_SL) <> 0 THEN SUM(SUM_J)/SUM(SUM_J_SL) ELSE SUM(SUM_J) END  SUM_J_DJ,\n\t\t\t\tSUM(SUM_D_SL) SUM_D_SL,\n\t\t       \tCASE WHEN SUM(SUM_D_SL) IS NULL OR SUM(SUM_D_SL) = 0 THEN 0 WHEN SUM(SUM_D) <> 0 AND SUM(SUM_D_SL) <> 0 THEN SUM(SUM_D)/SUM(SUM_D_SL) ELSE SUM(SUM_D) END  SUM_D_DJ,\n\t\t\t\tSUM(QMYE_SL) QMYE_SL,\n\t\t       \tCASE WHEN SUM(QMYE_SL) IS NULL OR SUM(QMYE_SL) = 0 THEN 0 WHEN SUM(QMYE_BWB) <> 0 AND SUM(QMYE_SL) <> 0 THEN SUM(QMYE_BWB)/SUM(QMYE_SL) ELSE SUM(QMYE_BWB) END  QMYE_DJ,\n\t\t\t\tSUM(SUM_JL_SL) SUM_JL_SL,\n\t\t       \tCASE WHEN SUM(SUM_JL_SL) IS NULL OR SUM(SUM_JL_SL) = 0 THEN 0 WHEN SUM(SUM_JL) <> 0 AND SUM(SUM_JL_SL) <> 0 THEN SUM(SUM_JL)/SUM(SUM_JL_SL) ELSE SUM(SUM_JL) END  SUM_JL_DJ,\n\t\t\t\tSUM(SUM_DL_SL) SUM_DL_SL,\n\t\t       \tCASE WHEN SUM(SUM_DL_SL) IS NULL OR SUM(SUM_DL_SL) = 0 THEN 0 WHEN SUM(SUM_DL) <> 0 AND SUM(SUM_DL_SL) <> 0 THEN SUM(SUM_DL)/SUM(SUM_DL_SL) ELSE SUM(SUM_DL) END  SUM_DL_DJ ";
    public static final String SELECT_KEY_VALUE_GT_ZW_WD_BILL_MX_SQL_FILED = " \t\t                ,NUMTYPE,NUMSCALETYPE,\n\t\t\t\t\t\tSUM(WD51) QCYE_SL,SUM(QCYE_HL) QCYE_DJ,\n\t\t\t\t\t\tSUM(WD52) SUM_J_SL,SUM(SUM_SL_J) SUM_J_DJ,\n\t\t\t\t\t\tSUM(WD53) SUM_D_SL,SUM(SUM_SL_D) SUM_D_DJ,\n\t\t\t\t\t\tSUM(WD54) QMYE_SL,SUM(QMYE_HL) QMYE_DJ,\n\t\t\t\t\t\tSUM(WD55) SUM_JL_SL,SUM(SUM_SL_JL) SUM_JL_DJ,\n\t\t\t\t\t\tSUM(WD56) SUM_DL_SL,SUM(SUM_SL_DL) SUM_DL_DJ ";
    public static final String GROUP_BY_ADD_NUM_TYPE = ",NUMTYPE,NUMSCALETYPE ";
    public static final String GROUP_BY_ADD_NUM_TYPE2 = " ,A1.MEASUR_UNIT,A1.MEAS_UNIT_GROUP_CODE, A1.BZLX ";
    public static final String MONTH_STA_CUR_KY_SELECT_CONDITION = ", A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE ,\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD WHEN {0} THEN  A.CR_QTY_S - A.DR_QTY_S  ELSE 0 END) QCYE_SL,\n\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD WHEN {0} THEN  A.CR_QTY_S - A.DR_QTY_S  ELSE 0 END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD  WHEN {0} THEN A.CR_BALP_S - A.DR_BALP_S ELSE 0 END) /  SUM(CASE A.ACC_PERIOD WHEN {0} THEN  A.CR_QTY_S - A.DR_QTY_S  ELSE 0 END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD  WHEN {0} THEN A.CR_BALP_S - A.DR_BALP_S ELSE 0 END)\n\t\t\tEND QCYE_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD WHEN {0} THEN A.CR_QTY_S*-1  ELSE A.CR_QTY_E END) SUM_J_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD WHEN {0} THEN A.CR_QTY_S*-1  ELSE A.CR_QTY_E END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD  WHEN {0} THEN (A.CR_BALP_S) * -1 ELSE A.CR_BALP_E END) /  SUM(CASE A.ACC_PERIOD WHEN {0} THEN A.CR_QTY_S*-1  ELSE A.CR_QTY_E END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD  WHEN {0} THEN (A.CR_BALP_S) * -1 ELSE A.CR_BALP_E END)\n\t\t\tEND SUM_J_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD WHEN {0} THEN A.DR_QTY_S*-1  ELSE A.DR_QTY_E END) SUM_D_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD WHEN {0} THEN A.DR_QTY_S*-1  ELSE A.DR_QTY_E END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD  WHEN {0} THEN (A.DR_BALP_S) * -1 ELSE A.DR_BALP_E END) /  SUM(CASE A.ACC_PERIOD WHEN {0} THEN A.DR_QTY_S*-1  ELSE A.DR_QTY_E END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD  WHEN {0} THEN (A.DR_BALP_S) * -1 ELSE A.DR_BALP_E END)\n\t\t\tEND SUM_D_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.CR_QTY_E - A.DR_QTY_E ELSE 0 END) QMYE_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.CR_QTY_E - A.DR_QTY_E ELSE 0 END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.CR_BALP_E - A.DR_BALP_E ELSE 0 END) /  SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.CR_QTY_E - A.DR_QTY_E ELSE 0 END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.CR_BALP_E - A.DR_BALP_E ELSE 0 END)\n\t\t\tEND QMYE_DJ,\t\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.CR_QTY_Y ELSE 0 END) SUM_JL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.CR_QTY_Y ELSE 0 END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.CR_AMT_Y ELSE 0 END) /  SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.CR_QTY_Y ELSE 0 END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.CR_AMT_Y ELSE 0 END)\n\t\t\tEND SUM_JL_DJ,\t\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.DR_QTY_Y ELSE 0 END) SUM_DL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.DR_QTY_Y ELSE 0 END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.DR_AMT_Y ELSE 0 END) /  SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.DR_QTY_Y ELSE 0 END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD  WHEN {1} THEN A.DR_AMT_Y ELSE 0 END)\n\t\t\tEND SUM_DL_DJ,\n\t\t\t\n\t\t\t9999 BZLX";
    public static final String MONTH_FOR_CUR_KY_SELECT_CONDITION = ", A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE,\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD WHEN {0} THEN CASE A.STA_CUR  WHEN -1 THEN 0 ELSE A.CR_QTY_S - A.DR_QTY_S END ELSE 0 END) QCYE_SL,\n\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD WHEN {0} THEN CASE A.STA_CUR  WHEN -1 THEN 0 ELSE A.CR_QTY_S - A.DR_QTY_S END ELSE 0 END)\n\t\t\t   THEN SUM(CASE A.ACC_PERIOD WHEN {0} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_S - A.DR_BALP_S END ELSE 0 END) /  SUM(CASE A.ACC_PERIOD WHEN {0} THEN CASE A.STA_CUR  WHEN -1 THEN 0 ELSE A.CR_QTY_S - A.DR_QTY_S END ELSE 0 END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD WHEN {0} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_S - A.DR_BALP_S END ELSE 0 END)\n\t\t\tEND QCYE_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD WHEN {0} THEN (CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_S END)*-1  ELSE\n\t\t\t\t\t\t\tCASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E END END)  SUM_J_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD WHEN {0} THEN (CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_S END)*-1  ELSE\n\t\t\t\t\t\t\tCASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E END END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD WHEN {0} THEN (CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_S END)*-1  ELSE\n\t\t\t\t\t\t\tCASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_E END END) /  SUM(CASE A.ACC_PERIOD WHEN {0} THEN (CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_S END)*-1  ELSE\n\t\t\t\t\t\t\tCASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E END END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD WHEN {0} THEN (CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_S END)*-1  ELSE\n\t\t\t\t\t\t\tCASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_E END END)\n\t\t\tEND SUM_J_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD WHEN {0} THEN (CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_S END)*-1  ELSE\n\t\t\t\t\t\t\tCASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_E END END)  SUM_D_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD WHEN {0} THEN (CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_S END)*-1  ELSE\n\t\t\t\t\t\t\tCASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_E END END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD WHEN {0} THEN (CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_BALP_S END)*-1  ELSE\n\t\t\t\t\t\t\tCASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_BALP_E END END) /  SUM(CASE A.ACC_PERIOD WHEN {0} THEN (CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_S END)*-1  ELSE\n\t\t\t\t\t\t\tCASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_E END END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD WHEN {0} THEN (CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_BALP_S END)*-1  ELSE\n\t\t\t\t\t\t\tCASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_BALP_E END END)\n\t\t\tEND SUM_D_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END ELSE 0 END) QMYE_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END ELSE 0 END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_E - A.DR_BALP_E END ELSE 0 END) /  SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END ELSE 0 END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_E - A.DR_BALP_E END ELSE 0 END)\n\t\t\tEND QMYE_DJ,\t\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END ELSE 0 END) SUM_JL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END ELSE 0 END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_AMT_Y END ELSE 0 END) /  SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END ELSE 0 END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_AMT_Y END ELSE 0 END)\n\t\t\tEND SUM_JL_DJ,\t\n\t\t\t\n\t\t\tSUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END ELSE 0 END) SUM_DL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END ELSE 0 END) <> 0 \n\t\t\t   THEN SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_AMT_Y END ELSE 0 END) /  SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END ELSE 0 END)\n\t\t\t   ELSE SUM(CASE A.ACC_PERIOD WHEN {1} THEN CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_AMT_Y END ELSE 0 END)\n\t\t\tEND SUM_DL_DJ,\t\n\t\t\t\n\t\t\t9999 BZLX";
    public static final String SE_STA_CUR_SELECT_CONDITION = ",A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE,\n\t\t\n\t\t\t SUM(A.CR_QTY_E - A.SE_DE_QTY- A.DR_QTY_E + A.SE_CR_QTY) QCYE_SL,\n\t\t\n\t\t\tCASE \n\t\t\t   WHEN  SUM(A.CR_QTY_E - A.SE_DE_QTY- A.DR_QTY_E + A.SE_CR_QTY) <> 0 \n\t\t\t   THEN SUM(A.CR_BALP_E - A.SE_DE_AMOUNT- A.DR_BALP_E + A.SE_CR_AMOUNT) /   SUM(A.CR_QTY_E - A.SE_DE_QTY- A.DR_QTY_E + A.SE_CR_QTY)\n\t\t\t   ELSE SUM(A.CR_BALP_E - A.SE_DE_AMOUNT- A.DR_BALP_E + A.SE_CR_AMOUNT)\n\t\t\tEND QCYE_DJ,\n\t\n\t\t\tSUM(A.SE_DE_QTY) SUM_J_SL, \n\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.SE_DE_QTY) <> 0 THEN SUM(A.SE_DE_AMOUNT) /  SUM(A.SE_DE_QTY)\n\t\t\t   ELSE SUM(A.SE_DE_AMOUNT)\n\t\t\tEND SUM_J_DJ,\n\t\t\t\n\t\t\tSUM(A.SE_CR_QTY) SUM_D_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.SE_CR_QTY) <> 0 THEN SUM(A.SE_CR_AMOUNT) /  SUM(A.SE_CR_QTY)\n\t\t\t   ELSE SUM(A.SE_CR_AMOUNT)\n\t\t\tEND SUM_D_DJ,\n\t\t\t\n\t\t\t SUM(A.CR_QTY_E - A.DR_QTY_E) QMYE_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN  SUM(A.CR_QTY_E - A.DR_QTY_E) <> 0 THEN SUM(A.CR_BALP_E - A.DR_BALP_E) /   SUM(A.CR_QTY_E - A.DR_QTY_E)\n\t\t\t   ELSE SUM(A.CR_BALP_E - A.DR_BALP_E)\n\t\t\tEND QMYE_DJ,\n\t\t\t\n\t\t\tSUM(A.CR_QTY_Y) SUM_JL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_Y) <> 0 THEN SUM(A.CR_AMT_Y) /  SUM(A.CR_QTY_Y)\n\t\t\t   ELSE SUM(A.CR_AMT_Y)\n\t\t\tEND SUM_JL_DJ,\n\t\t\t\n\t\t\tSUM(A.DR_QTY_Y) SUM_DL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.DR_QTY_Y) <> 0 THEN SUM(A.DR_AMT_Y) /  SUM(A.DR_QTY_Y)\n\t\t\t   ELSE SUM(A.DR_AMT_Y)\n\t\t\tEND SUM_DL_DJ,\n\t\t\t\n\t\t\t9999 BZLX\t";
    public static final String SE_FOR_CUR_SELECT_CONDITION = ",A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE, \n\t\t\n\t\t\t SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_E - A.SE_DE_QTY  - A.DR_QTY_E  + A.SE_CR_QTY END) QCYE_SL,\n\t\t\n\t\t\tCASE \n\t\t\t   WHEN  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_E - A.SE_DE_QTY  - A.DR_QTY_E  + A.SE_CR_QTY END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_BALP_E  - A.SE_DE_AMOUNT - A.DR_BALP_E  +  A.SE_CR_AMOUNT END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_E - A.SE_DE_QTY  - A.DR_QTY_E  + A.SE_CR_QTY END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_BALP_E  - A.SE_DE_AMOUNT - A.DR_BALP_E  +  A.SE_CR_AMOUNT END)\n\t\t\tEND QCYE_DJ,\n\t\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.SE_DE_QTY END) SUM_J_SL, \n\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.SE_DE_QTY END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.SE_DE_AMOUNT END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.SE_DE_QTY END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.SE_DE_AMOUNT END)\n\t\t\tEND SUM_J_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.SE_CR_QTY END) SUM_D_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.SE_CR_QTY END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.SE_CR_AMOUNT END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.SE_CR_QTY END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.SE_CR_AMOUNT END)\n\t\t\tEND SUM_D_DJ,\n\t\t\t\n\t\t\t SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_E - A.DR_QTY_E END) QMYE_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_E - A.DR_QTY_E END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_BALP_E  -  A.DR_BALP_E END) /   SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_E - A.DR_QTY_E END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_BALP_E  -  A.DR_BALP_E END)\n\t\t\tEND QMYE_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_Y END) SUM_JL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_Y END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_AMT_Y END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_AMT_Y END)\n\t\t\tEND SUM_JL_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_Y END) SUM_DL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_Y END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_AMT_Y END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_AMT_Y END)\n\t\t\tEND SUM_DL_DJ,\n\t\t\t\n\t\t\t9999 BZLX";
    public static final String YEAR_STA_CUR_SELECT_CONDITION = "\t\t\t,A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE,\n\t\t\t SUM(A.CR_QTY_E - A.DR_QTY_E - A.CR_QTY_Y + A.DR_QTY_Y) QCYE_SL, \n\t\t\tCASE \n\t\t\t   WHEN  SUM(A.CR_QTY_E - A.DR_QTY_E - A.CR_QTY_Y + A.DR_QTY_Y) <> 0 \n\t\t\t   THEN SUM( A.CR_BALP_E - A.DR_BALP_E - A.CR_AMT_Y + A.DR_AMT_Y) /   SUM(A.CR_QTY_E - A.DR_QTY_E - A.CR_QTY_Y + A.DR_QTY_Y)\n\t\t\t   ELSE SUM(A.CR_BALP_E - A.DR_BALP_E - A.CR_AMT_Y + A.DR_AMT_Y )\n\t\t\tEND QCYE_DJ,\n\t\t\t\n\t\t\t\n\t\t\tSUM(A.CR_QTY_Y) SUM_J_SL, \n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_Y) <> 0 THEN SUM(A.CR_AMT_Y) /  SUM(A.CR_QTY_Y)\n\t\t\t   ELSE SUM(A.CR_AMT_Y)\n\t\t\tEND SUM_J_DJ,\n\t\t\t\n\t\t\tSUM(A.DR_QTY_Y) SUM_D_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.DR_QTY_Y) <> 0 THEN SUM(A.DR_AMT_Y) /  SUM(A.DR_QTY_Y)\n\t\t\t   ELSE SUM(A.DR_AMT_Y)\n\t\t\tEND SUM_D_DJ,\n\t\t\t\n\t\t\t SUM(A.CR_QTY_E - A.DR_QTY_E) QMYE_SL,\n\t\t\n\t\t\tCASE \n\t\t\t   WHEN  SUM(A.CR_QTY_E - A.DR_QTY_E) <> 0 THEN SUM(A.CR_BALP_E - A.DR_BALP_E) /   SUM(A.CR_QTY_E - A.DR_QTY_E)\n\t\t\t   ELSE SUM(A.CR_BALP_E - A.DR_BALP_E)\n\t\t\tEND QMYE_DJ,\n\t\t\n\t\t\tSUM(A.CR_QTY_Y) SUM_JL_SL,\n\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.CR_QTY_Y) <> 0 THEN SUM(A.CR_AMT_Y) /  SUM(A.CR_QTY_Y)\n\t\t\t   ELSE SUM(A.CR_AMT_Y)\n\t\t\tEND SUM_JL_DJ,\n\t\t\t\n\t\t\tSUM(A.DR_QTY_Y) SUM_DL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(A.DR_QTY_Y) <> 0 THEN SUM(A.DR_AMT_Y) /  SUM(A.DR_QTY_Y)\n\t\t\t   ELSE SUM(A.DR_AMT_Y)\n\t\t\tEND SUM_DL_DJ,\n\t\t\t9999 BZLX";
    public static final String YEAR_FOR_CUR_SELECT_CONDITION = ",A.MEASUR_UNIT,A.MEAS_UNIT_GROUP_CODE,\n\t\t\t SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E - A.CR_QTY_Y + A.DR_QTY_Y END) QCYE_SL, \n\t\t\tCASE \n\t\t\t   WHEN  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E - A.CR_QTY_Y + A.DR_QTY_Y END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_BALP_E - A.DR_BALP_E - A.CR_AMT_Y + A.DR_AMT_Y END) /   SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E - A.CR_QTY_Y + A.DR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_BALP_E - A.DR_BALP_E - A.CR_AMT_Y + A.DR_AMT_Y END)\n\t\t\tEND QCYE_DJ,\n\t\t\t\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_Y END) SUM_J_SL, \n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_Y END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_AMT_Y END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.CR_AMT_Y END)\n\t\t\tEND SUM_J_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_Y END) SUM_D_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_Y END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_AMT_Y END) /  SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR WHEN -1 THEN 0 ELSE A.DR_AMT_Y END)\n\t\t\tEND SUM_D_DJ,\n\t\t\t\n\t\t\t SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END) QMYE_SL,\n\t\t\n\t\t\tCASE \n\t\t\t   WHEN  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_E - A.DR_BALP_E END) /   SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_E - A.DR_QTY_E END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_BALP_E - A.DR_BALP_E END)\n\t\t\tEND QMYE_DJ,\n\t\t\n\t\t\t SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END) SUM_JL_SL,\n\n\t\t\tCASE \n\t\t\t   WHEN  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END) <> 0 \n\t\t\t   THEN  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_AMT_Y END) /   SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_QTY_Y END)\n\t\t\t   ELSE  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.CR_AMT_Y END)\n\t\t\tEND SUM_JL_DJ,\n\t\t\t\n\t\t\tSUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END) SUM_DL_SL,\n\t\t\t\n\t\t\tCASE \n\t\t\t   WHEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END) <> 0 \n\t\t\t   THEN SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_AMT_Y END) /  SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_QTY_Y END)\n\t\t\t   ELSE SUM(CASE A.STA_CUR  WHEN -1 THEN  0  ELSE A.DR_AMT_Y END)\n\t\t\tEND SUM_DL_DJ,\n\t\t\t9999 BZLX";
    public static final String SHOW_ALL_DIM_CONDITION_INSERT_INTO_MX = "\t\t\t   ,NUMTYPE,NUMSCALETYPE,\n                WD51,QCYE_HL,\n                WD52,SUM_SL_J,\n                WD53,SUM_SL_D,\n                WD54,QMYE_HL,\n                WD55,SUM_SL_JL,\n                WD56,SUM_SL_DL ";
    public static final String SHOW_ALL_DIM_CONDITION_SELECT_MX = "\t\t\t         \t\t\t   ,A.NUMTYPE,A.NUMSCALETYPE,\n                A.WD51,A.QCYE_HL,\n                A.WD52,A.SUM_SL_J,\n                A.WD53,A.SUM_SL_D,\n                A.WD54,A.QMYE_HL,\n                A.WD55,A.SUM_SL_JL,\n                A.WD56,A.SUM_SL_DL ";

    public AccComprehensiveQueryQtySqlDaoConst() {
    }

    public static String getQtyTable(String balTable) {
        return balTable.replace("_BAL_", "_QTY_");
    }

    public static final String changeAWdConcatFieldForQtyMethod(String wdConcat) {
        wdConcat = wdConcat.replace("NUMTYPE", "DIM_CAP001");
        wdConcat = wdConcat.replace("QCYE_SL", "DIM_CAP002");
        wdConcat = wdConcat.replace("QCYE_DJ", "DIM_CAP003");
        wdConcat = wdConcat.replace("SUM_J_SL", "DIM_CAP004");
        wdConcat = wdConcat.replace("SUM_J_DJ", "DIM_CAP005");
        wdConcat = wdConcat.replace("SUM_D_SL", "DIM_CAP006");
        wdConcat = wdConcat.replace("SUM_D_DJ", "DIM_CAP007");
        wdConcat = wdConcat.replace("QMYE_SL", "DIM_CAP008");
        wdConcat = wdConcat.replace("QMYE_DJ", "DIM_CAP009");
        wdConcat = wdConcat.replace("SUM_JL_SL", "DIM_CAP010");
        wdConcat = wdConcat.replace("SUM_JL_DJ", "DIM_CAP011");
        wdConcat = wdConcat.replace("SUM_DL_SL", "DIM_CAP012");
        wdConcat = wdConcat.replace("SUM_DL_DJ", "DIM_CAP013");
        wdConcat = wdConcat.replace("NUMSCALETYPE", "DIM_CAP014");
        return wdConcat;
    }

    public static final String changeExportColFieldForQtyMethod(String col) {
        col = col.replace("NUMTYPE", "DIM_CAP001 NUMTYPE");
        col = col.replace("QCYE_SL", "DIM_CAP002 QCYE_SL");
        col = col.replace("QCYE_DJ", "DIM_CAP003 QCYE_DJ");
        col = col.replace("SUM_J_SL", "DIM_CAP004 SUM_J_SL");
        col = col.replace("SUM_J_DJ", "DIM_CAP005 SUM_J_DJ");
        col = col.replace("SUM_D_SL", "DIM_CAP006 SUM_D_SL");
        col = col.replace("SUM_D_DJ", "DIM_CAP007 SUM_D_DJ");
        col = col.replace("QMYE_SL", "DIM_CAP008 QMYE_SL");
        col = col.replace("QMYE_DJ", "DIM_CAP009 QMYE_DJ");
        col = col.replace("SUM_JL_SL", "DIM_CAP010 SUM_JL_SL");
        col = col.replace("SUM_JL_DJ", "DIM_CAP011 SUM_JL_DJ");
        col = col.replace("SUM_DL_SL", "DIM_CAP012 SUM_DL_SL");
        col = col.replace("SUM_DL_DJ", "DIM_CAP013 SUM_DL_DJ");
        col = col.replace("NUMSCALETYPE", "DIM_CAP014 NUMSCALETYPE");
        return col;
    }

    public static final String changeAWdConcatFieldForYjzMethod(String wdConcat) {
        wdConcat = wdConcat.replace("SUM_J_BWB_YJZ", "DIM_CAP001");
        wdConcat = wdConcat.replace("SUM_D_BWB_YJZ", "DIM_CAP002");
        wdConcat = wdConcat.replace("SUM_JL_BWB_YJZ", "DIM_CAP003");
        wdConcat = wdConcat.replace("SUM_DL_BWB_YJZ", "DIM_CAP004");
        wdConcat = wdConcat.replace("SUM_J_BWB_WJZ", "DIM_CAP005");
        wdConcat = wdConcat.replace("SUM_D_BWB_WJZ", "DIM_CAP006");
        wdConcat = wdConcat.replace("QCYE_BWB_YJZ", "DIM_CAP007");
        wdConcat = wdConcat.replace("QMYE_BWB_YJZ", "DIM_CAP008");
        wdConcat = wdConcat.replace("SUM_J_YJZ", "DIM_CAP009");
        wdConcat = wdConcat.replace("SUM_D_YJZ", "DIM_CAP010");
        wdConcat = wdConcat.replace("SUM_JL_YJZ", "DIM_CAP011");
        wdConcat = wdConcat.replace("SUM_DL_YJZ", "DIM_CAP012");
        wdConcat = wdConcat.replace("SUM_J_WJZ", "DIM_CAP013");
        wdConcat = wdConcat.replace("SUM_D_WJZ", "DIM_CAP014");
        wdConcat = wdConcat.replace("QCYE_YJZ", "DIM_CAP015");
        wdConcat = wdConcat.replace("QMYE_YJZ", "DIM_CAP016");
        return wdConcat;
    }

    public static final String changeExportColFieldForYjzMethod(String col) {
        col = col.replace("SUM_J_BWB_YJZ", "DIM_CAP001 SUM_J_BWB_YJZ");
        col = col.replace("SUM_D_BWB_YJZ", "DIM_CAP002 SUM_D_BWB_YJZ");
        col = col.replace("SUM_JL_BWB_YJZ", "DIM_CAP003 SUM_JL_BWB_YJZ");
        col = col.replace("SUM_DL_BWB_YJZ", "DIM_CAP004 SUM_DL_BWB_YJZ");
        col = col.replace("SUM_J_BWB_WJZ", "DIM_CAP005 SUM_J_BWB_WJZ");
        col = col.replace("SUM_D_BWB_WJZ", "DIM_CAP006 SUM_D_BWB_WJZ");
        col = col.replace("QCYE_BWB_YJZ", "DIM_CAP007 QCYE_BWB_YJZ");
        col = col.replace("QMYE_BWB_YJZ", "DIM_CAP008 QMYE_BWB_YJZ");
        col = col.replace("SUM_J_YJZ", "DIM_CAP009 SUM_J_YJZ");
        col = col.replace("SUM_D_YJZ", "DIM_CAP010 SUM_D_YJZ");
        col = col.replace("SUM_JL_YJZ", "DIM_CAP011 SUM_JL_YJZ");
        col = col.replace("SUM_DL_YJZ", "DIM_CAP012 SUM_DL_YJZ");
        col = col.replace("SUM_J_WJZ", "DIM_CAP013 SUM_J_WJZ");
        col = col.replace("SUM_D_WJZ", "DIM_CAP014 SUM_D_WJZ");
        col = col.replace("QCYE_YJZ", "DIM_CAP015 QCYE_YJZ");
        col = col.replace("QMYE_YJZ", "DIM_CAP016 QMYE_YJZ");
        return col;
    }

    static {
        MONTH_STA_CUR_INSERT_INTO_GT_GENERAL_SES = SqlResource.getSql(SQL_CLASS, "MONTH_STA_CUR_INSERT_INTO_GT_GENERAL_SES", new String[0]);
        MONTH_STA_CUR_INSERT_INTO_GT_ZW_WD_BILL_MX_FROM_GT_GENERAL_SES = SqlResource.getSql(SQL_CLASS, "MONTH_STA_CUR_INSERT_INTO_GT_ZW_WD_BILL_MX_FROM_GT_GENERAL_SES", new String[0]);
        MONTH_FOR_CUR_INSERT_INTO_GT_GENERAL_SES = SqlResource.getSql(SQL_CLASS, "MONTH_FOR_CUR_INSERT_INTO_GT_GENERAL_SES", new String[0]);
        MONTH_FOR_CUR_INSERT_INTO_GT_ZW_WD_BILL_MX_FROM_GT_GENERAL_SES = SqlResource.getSql(SQL_CLASS, "MONTH_FOR_CUR_INSERT_INTO_GT_ZW_WD_BILL_MX_FROM_GT_GENERAL_SES", new String[0]);
    }
}

